local wen__xiangying = fk.CreateSkill {
  name = "wen__xiangying",
}

Fk:loadTranslationTable{
  ["wen__xiangying"] = "相影",
  [":wen__xiangying"] = "当你使用【杀】或【过河拆桥】指定目标后，你可以弃置一张非基本牌，令此牌额外结算一次。",

  ["#wen__xiangying"] = "相影：你可以弃置一张非基本牌，令此牌额外结算一次",
}

wen__xiangying:addEffect(fk.TargetSpecified, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player
    and player:hasSkill(wen__xiangying.name)
    and (data.card.trueName == "slash" or data.card.trueName == "dismantlement")
    and not player:isNude()
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local card = room:askToDiscard(player, {
      min_num = 1,
      max_num = 1,
      include_equip = true,
      skill_name = wen__xiangying.name,
      pattern = ".|.|.|.|.|^basic",
      prompt = "#wen__xiangying",
      cancelable = true,
      skip = true,
    })
    if #card > 0 then
      event:setCostData(self, {cards = card})
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:throwCard(event:getCostData(self).cards, wen__xiangying.name, player, player)
    data.use.additionalEffect = (data.use.additionalEffect or 0) + 1
  end,
})

return wen__xiangying